<template>
  <div id="app">
    <template v-if="route.path.startsWith('/user')">
      <router-view/>
    </template>
    <template v-else>
      <BasicLayout />
    </template>

  </div>
</template>

<style>
#app {

}
</style>
<script setup lang="ts">
import BasicLayout from "@/layouts/BasicLayout.vue";
import {useRoute, useRouter} from "vue-router";
import {useStore} from "vuex";
import {onMounted} from "vue";

// const store = useStore();
//全局初始化，类似于static块
const route = useRoute();
const doInit = () => {
  console.log("您好，欢迎来到OJ系统")
}

onMounted(() => {
  doInit();
})

// router.beforeEach((to, from, next) => {
//   // console.log(to)
//   if(to.meta?.access === "AdminOnly") {
//     if(store.state.user.loginUser?.userRole !== "admin") {
//       next('/noAuth');
//       return;
//     }
//   }
//   next();
// })

</script>